import request from '@/utils/request'

// 获取角色选项  /admin/user/role
export function getRoleList() {
  return request({
    url: '/admin/user/role',
    method: 'get'
  })
}

//获取后台角色列表
export function getRoleListPage(params) {
  return request({
    url: '/admin/role/list',
    method: 'get',
    params: params
  })
}

//修改角色状态
export function updateRoleStatus(data) {
  return request({
    url: '/admin/role/changeStatus',
    method: 'put',
    data: data
  })
}

//删除角色
export function deleteRole(ids) {
  return request({
    url: '/admin/role/delete',
    method: 'delete',
    data: ids
  })
}

//添加用户角色
export function addRole(data) {
  return request({
    url: '/admin/role/add',
    method: 'post',
    data: data
  })
}

//获取角色菜单列表
export function getRoleMenuTree(roleId) {
  return request({
    url: '/admin/role/menu/' + roleId,
    method: 'get'
  })
}

//修改用户角色
export function updateRole(data) {
  return request({
    url: '/admin/role/update',
    method: 'put',
    data: data
  })
}




